package com.dss.sdk.api.client;

import com.dss.sdk.api.base.BaseApi;
import com.dss.sdk.api.req.*;
import com.dss.sdk.api.resp.*;
import com.dss.sdk.api.service.DssClientService;
import com.dss.sdk.constants.ApiUrlConstants;
import com.dss.sdk.exception.ApiException;
import com.dss.sdk.response.DssEntityResponse;
import com.dss.sdk.response.DssResponse;

/**
 * @author Fadada
 */
public class ZxcaApiClient extends BaseApi {

    public ZxcaApiClient(DssClientService clientService) {
        super(clientService);
    }

    public DssResponse<CertApplyResponse> applyPerson(CertApplyPersonRequest certApplyPersonRequest) throws ApiException {
        return clientService.execute(certApplyPersonRequest, ApiUrlConstants.applyPerson, CertApplyResponse.class);
    }

    public DssResponse<CertApplyResponse> applyCompany(CertApplyCompanyRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.applyCompany, CertApplyResponse.class);
    }

    public DssResponse<CertApplyResponse> applyUrl(ZxcaWebUrlRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.applyUrl, CertApplyResponse.class);
    }

    public DssResponse<CertApplyInfoResponse> queryCertApply(CertApplyBaseRequest certApplyBaseRequest) throws ApiException {
        return clientService.execute(certApplyBaseRequest, ApiUrlConstants.queryCertApply, CertApplyInfoResponse.class);
    }

    public DssResponse<CertInfoResponse> queryCertInfo(CertInfoRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.queryCertInfo, CertInfoResponse.class);
    }

    public DssResponse<ZxcaUserDetailResponse> queryPersonInfo(ZxcaUserDetailRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.queryPersonInfo, ZxcaUserDetailResponse.class);
    }

    public DssResponse<ZxcaCorpDetailResponse> queryCompanyInfo(ZxcaUserDetailRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.queryCompanyInfo, ZxcaCorpDetailResponse.class);
    }

    public DssResponse<CertApplyInfoResponse> raCertApplyPerson(RaCertApplyPersonRequest raCertApplyPersonRequest) throws ApiException {
        return clientService.execute(raCertApplyPersonRequest, ApiUrlConstants.raCertApplyPerson, CertApplyInfoResponse.class);
    }

    public DssResponse<CertApplyInfoResponse> raCertApplyCompany(RaCertApplyCompanyRequest raCertApplyCompanyRequest) throws ApiException {
        return clientService.execute(raCertApplyCompanyRequest, ApiUrlConstants.raCertApplyCompany, CertApplyInfoResponse.class);
    }

    public DssResponse<ZxcaFileUploadResponse> filePreUpload(ZxcaFileUploadRequest fileUploadRequest) throws ApiException {
        return clientService.execute(fileUploadRequest, ApiUrlConstants.certUpload, ZxcaFileUploadResponse.class);
    }

    public DssResponse<DssEntityResponse> download(SealDownloadRequest sealDownloadRequest) throws ApiException {
        return clientService.executeDownload(sealDownloadRequest, ApiUrlConstants.zxcaDownload);
    }

    public DssResponse<ZxcaTransactionIdResponse> zxcaUserApiTransCreate(ApiUserTransCreateRequest apiUserTransCreateRequest) throws ApiException {
        return clientService.execute(apiUserTransCreateRequest, ApiUrlConstants.zxcaUserApiTransCreate, ZxcaTransactionIdResponse.class);
    }

    public DssResponse<ZxcaFaceUrlResponse> userApiTransFaceUrl(ZxcaApiUserFaceUrlRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransFaceUrl, ZxcaFaceUrlResponse.class);
    }

    public DssResponse userApiTransVerificationCode(ZxcaApiUserCodeRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransVerificationCode, Void.class);
    }

    public DssResponse<CertApplyInfoResponse> userApiTransMobile(ZxcaApiUserMobileRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransMobile, CertApplyInfoResponse.class);
    }

    public DssResponse<CertApplyInfoResponse> userApiTransBankAccount(ZxcaApiUserBankRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransBankAccount, CertApplyInfoResponse.class);
    }

    public DssResponse<ZxcaGesturePhotoNumResponse> userApiTransGesturePhotoNum(ZxcaApiUserGesturePhotoNumRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransGesturePhotoNum, ZxcaGesturePhotoNumResponse.class);
    }

    public DssResponse userApiTransSubmitAuditMaterials(ZxcaApiUserAuditRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransSubmitAuditMaterials, Void.class);
    }

    public DssResponse userApiTransCancelAuditTicket(ZxcaApiUserCancelAuditRequest request) throws ApiException {
        return clientService.execute(request, ApiUrlConstants.userApiTransCancelAuditTicket, Void.class);
    }

}
